<?php

declare(strict_types=1);

namespace App\Model;

use Hyperf\DbConnection\Model\Model;
use Hyperf\DbConnection\Db;

/**
 * 邀请链接是否屏蔽
 */
class ShareSwitch extends Model
{
    protected $table = 'share_switch';

    protected $fillable = [
        "flag","created_at", "updated_at"
    ];

    /**
     * 是否屏蔽 : 0: 已屏蔽; 1:未屏蔽
     */
    static function checkShareLink()
    {
        $item = self::query()->orderBy('id', 'desc')->first();
        return $item['flag'];
    }
}

